﻿
namespace Mulala.Cavan.TestAppService.CorporationModule
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Spring.Context;
    using NUnit.Framework;
    using Spring.Context.Support;
    using Mulala.Cavan.Application.MainBoundedContext.CorporationModule;
    using Mulala.Cavan.Domain.Seedwork;
    using Mulala.Cavan.Domain.MainBoundedContext.CorporationModule;
    using Mulala.Cavan.Domain.MainBoundedContext.InformationModule;
    using Mulala.Cavan.Domain.MainBoundedContext.SecurityModule;
    using Mulala.Cavan.Application.MainBoundedContext.MulalaModule;

    public class TestCorporationAppService
    {
        private IApplicationContext context;
        private ICorporationAppService CorporationAppService { get; set; }

        [SetUp]
        public void SetUp()
        {
            context = ContextRegistry.GetContext();
            this.CorporationAppService = this.context.GetObject(MulalaAppServiceConst.CORPORATIONAPPSERVICE) as ICorporationAppService;
        }

        [Test]
        public void TestGetById()
        {
            Corporation corporation = this.CorporationAppService.GetById(27);

            Assert.IsNotNull(corporation);
        }

        [Test]
        public void TestUpdateCorporationRefreshTime()
        {
            BoolGenericResult<CorporationStatus> result = this.CorporationAppService.UpdateCorporationRefreshTime(CorporationFactory.CreateCorporation(27));

            Assert.AreEqual(true, result.IsSuccess);
        }
    }
}
